Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python package #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Python package #1

wants to merge 4 commits into from

Conversation

PinusSilvestris
Copy link
Collaborator

Hejka, zrobiłem (?) refactor kodu, tak, żeby zrobić z tego pakiet do pythona. Wszystkie pomysły i uwagi mile widziane.

setup.py Outdated Show resolved Hide resolved
tests/test_voa.py Outdated Show resolved Hide resolved
tests/test_voa.py Show resolved Hide resolved
voa/copula.py Outdated
@@ -26,23 +28,25 @@ def create_Q_grid(n=10):

return grid


@numba.njit(parallel=True)
def calculate_copula_part(t, c):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please type function signature, and use more verbose parameter names

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the signatures. The names are kept according to the paper and the initial implementation. We can change it, but I think it will not make the code more readable as someone will need to "translate" the names from our code to the equations from original c# implementation.

setup.py Show resolved Hide resolved
voa/copula.py Outdated
c[i, j] = c[0, j] + n_inv * np.sum(j >= t[:i])
return c


@numba.njit
def wn(n, c, i, j):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can maybe accept very short parameter names, but please name function verbosely.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as above applies here. The name wn come from the paper. We can change all the names, but the question is if we should. @mp360288 wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense then if it comes from paper. For readability imo you can do two things:

  • add docstring
  • differentiate between public and private API - I guess this wn function will never be called by user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants